{extend name="public:base" /}


{block name="content"}
	  <!-- 搜索 开始 -->
    <div class="back_btn">
        <!-- 返回按钮 -->
        <button class="btn btn_color" type="button" style="outline: none;">
            <a href="{:url('index')}"><span class="glyphicon glyphicon-arrow-left" style="color:#3c8dbc;font-size: 18px;"></span></a>
        </button>
        <button type="button" class="btn btn-info btn-xs pull-right " style="margin: 10px 10px;">
            <a href="{:url('index')}">返回首页</a>
        </button>
    </div>
    <!-- 搜索 结束 -->
    <!-- 列表 -->
    <table class="table table-bordered table_color">
       <thead>
         <tr>
           <th>转ID</th>
           <th>顾客</th>
           <th>电话</th>
           <th>推荐人</th>
           <th>推荐时间</th>
           <!--<th>备注</th>-->
         </tr>
       </thead>
       <tbody>
       {volist name='list' id="vo"  key="ev"  empty="暂时没有数据" }
         <tr role="button" data-toggle="collapse" href="#{$ev}" aria-expanded="false" aria-controls="collapseExample" id="id{$vo.id}">
           <td>{$vo.id}</td>
           <td>{$vo.name}</td>
           <td>{$vo.tel}</td>
           <td>{$vo.username}</td>
           <td>{$vo.tjtime|date="Y-m-d H:i",###}</td>
           <!--<td>{$vo.bz}</td>-->
         </tr>
         <tr id="details_open" style="background: none;border:0;">
            <td colspan="12" style="background: none;padding:0;">
                <div class="collapse" id="{$ev}" align="center">
                    <div align="left"><span style="color: red;font-size:18px;">备注:</span>{$vo.bz}</div>
                    <a class="btn btn-nopadding" href="javascript:tongguo('{:url('admin/order/sh',['id'=>$vo['id'],'act'=>1,'khd'=>2] )}');"><button type="button" class="btn btn-success"> 通&nbsp;&nbsp;过 </button></a>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <a class="btn btn-nopadding" href="javascript:jujue('{:url('admin/order/sh',['id'=>$vo['id'],'act'=>2,'khd'=>2] )}');"  ><button type="button" class="btn btn-danger"> 拒&nbsp;&nbsp;绝 </button></a>
                </div>
            </td>
        </tr>
       {/volist}

        </tbody>
    </table>
    <!-- 翻页 -->
    <div class="page_div">{$page}
    </div>
{/block}
{block name="js"}
<script type="text/javascript" src="__JS__/jquery-3.2.0.min.js"></script>
<script type="text/javascript" src="__JS__/bootstrap.min.js"></script>
<script type="text/javascript" src="__STATIC__/layer/layer.js"></script>

    <script type="text/javascript">
        $(function () {
            var id = {$editid};
            if(id != 0){
                document.getElementById('id'+id).scrollIntoView();
                $("#id"+id).css('background','#aaa');
            }
        });
    </script>

    <script type="text/javascript">
//        function sh(name) {
//            $.post(name,function(data){
////                    console.log(data);
//                layer.msg(data.msg, {
//                    icon: data.code,
//                    time:3000,
//                },function(){
//                    location.href = '{:url("mobile/index/zjsshenhe")}';
//                });
//            });
//        }

        function tongguo(name){
            layer.confirm('您确定审核通过？', {
                btn: ['确定','取消'] //按钮
            }, function(index){
                layer.close(index);
                $.post(name,function(data){
                    layer.msg(data.msg, {
                        icon: data.code,
                        time:3000,
                    },function(){
                        location.href = '{:url("mobile/index/zjsshenhe")}';
                    });
                });
            });
        }
        function jujue(name){
            layer.prompt({title: '请填写拒绝理由，并确认', formType: 2}, function(text, index){
                layer.close(index);
                name = name.replace('.html','/jujueliyou/'+text+'.html');
                $.post(name,function(data){
                    layer.msg(data.msg, {
                        icon: data.code,
                        time:3000,
                    },function(){
                        location.href = '{:url("mobile/index/zjsshenhe")}';
                    });
                });
            });
        }
    </script>

{/block}